require.config
    baseUrl:'/assets/static/'
    urlArgs: "_v=1.0"+Math.random(),
    paths:
        'jquery':'libs/jquery.min'
        'controller':'js/controller'
        'model':'js/model'
        'view':'js/view'
#主入口函数,需要在script标签上绑定data-controller标记
#才能正确执行
#@example
#  <script data-main="static/js/main.js" data-controller="index" src="static/libs/require.js"></script>
require ['jquery'],($)->
    $('script[data-controller]').each ()->
        module = @getAttribute('data-controller')
        cname = 'js/controller/'+module+''
        require [cname],(controller)->
            app = new controller